#include "testlib.h"
#include <iostream>
#include <string>
#include <vector>
#include <tuple>
using namespace std;

int main(int argc, char* argv[]) {
    registerTestlibCmd(argc, argv);
    
    // 读取输入
    int n = inf.readInt();
    vector<tuple<int, int, int>> presents(n);
    for (int i = 0; i < n; i++) {
        int p = inf.readInt();
        int a = inf.readInt();
        int b = inf.readInt();
        presents[i] = make_tuple(p, a, b);
    }
    
    int q = inf.readInt();
    vector<int> initialMoods(q);
    for (int i = 0; i < q; i++) {
        initialMoods[i] = inf.readInt();
    }
    
    // 逐行比较标准输出和用户输出
    for (int i = 0; i < q; i++) {
        long long ansMood = ans.readLong();
        long long userMood = ouf.readLong();
        
        if (ansMood != userMood) {
            quitf(_wa, "第 %d 个问题答案不匹配：期望 %lld，但用户输出 %lld", i + 1, ansMood, userMood);
        }
    }
    
    // 如果通过检查，则输出正确
    quitf(_ok, "答案正确");
}